2004-07-16 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkcombobox.c (gtk_combo_box_scroll_event): Make
+ scrolling work if no item is selected.
+ (gtk_cell_editable_key_press): Don't eat space.
+
Add a combo box cell renderer (#139347, Lorenzo Gil Sanchez)
* gtk/gtkcellrenderercombo.[hc]: New Files.
2004-07-16 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkcombobox.c (gtk_combo_box_scroll_event): Make
+ scrolling work if no item is selected.
+ (gtk_cell_editable_key_press): Don't eat space.
+
Add a combo box cell renderer (#139347, Lorenzo Gil Sanchez)
* gtk/gtkcellrenderercombo.[hc]: New Files.
2004-07-16 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkcombobox.c (gtk_combo_box_scroll_event): Make
+ scrolling work if no item is selected.
+ (gtk_cell_editable_key_press): Don't eat space.
+
Add a combo box cell renderer (#139347, Lorenzo Gil Sanchez)
* gtk/gtkcellrenderercombo.[hc]: New Files.
2004-07-16 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkcombobox.c (gtk_combo_box_scroll_event): Make
+ scrolling work if no item is selected.
+ (gtk_cell_editable_key_press): Don't eat space.
+
Add a combo box cell renderer (#139347, Lorenzo Gil Sanchez)
* gtk/gtkcellrenderercombo.[hc]: New Files.
index = gtk_combo_box_get_active (combo_box);
- if (index != -1)
+ items = gtk_tree_model_iter_n_children (combo_box->priv->model, NULL);
+
+ if (event->direction == GDK_SCROLL_UP)
{
- items = gtk_tree_model_iter_n_children (combo_box->priv->model, NULL);
-
- if (event->direction == GDK_SCROLL_UP)
- {
- new_index = index - 1;
- while (new_index >= 0 && !row_is_sensitive (combo_box, new_index))
- new_index--;
- if (new_index < 0)
- new_index = index;
- }
- else
- {
- new_index = index + 1;
- while (new_index < items && !row_is_sensitive (combo_box, new_index))
- new_index++;
- if (new_index == items)
- new_index = index;
- }
-
- gtk_combo_box_set_active (combo_box, CLAMP (new_index, 0, items - 1));
+ new_index = index - 1;
+ while (new_index >= 0 && !row_is_sensitive (combo_box, new_index))
+ new_index--;
+ if (new_index < 0)
+ new_index = index;
}
+ else
+ {
+ new_index = index + 1;
+ while (new_index < items && !row_is_sensitive (combo_box, new_index))
+ new_index++;
+ if (new_index == items)
+ new_index = index;
+ }
+
+ gtk_combo_box_set_active (combo_box, new_index);
return TRUE;
}
return TRUE;
}
- else if (event->keyval == GDK_space)
- {
- /* ignore */
- return TRUE;
- }
return FALSE;
}